//
// Created by Chen qin lang on 2018/7/6.
//

#ifndef CQAUDIO_JAVACALL_H
#define CQAUDIO_JAVACALL_H


#include <jni.h>
#define MAIN_THREAD 0
#define CHILD_THREAD 1

class JavaCall {
public:
    _JavaVM* javaVM;
    JNIEnv*jniEnv;
    jobject instance;
    jmethodID id;
    jmethodID errorId;
    jmethodID callLoadid;
    jmethodID  callTimeinfo;
    jmethodID  callComplete;
public:
    JavaCall(_JavaVM *javaVM, JNIEnv *jniEnv, jobject instance);
    ~JavaCall();
    void onError(int type);
    void onPrepared(int type);
    void onCallLoad(int type , bool isload);
    void callTimeInfo(int type, int currentTime,int tatolTime);
    void onCallComplete(int type);
};


#endif //CQAUDIO_JAVACALL_H
